<!--{*
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
*}-->

<div id="alpha">
<div id="alpha-inner">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</div>
</div>



<div id="beta">
<div id="beta-inner">
<form name="form1" id="form1" method="POST" action="<!--{$smarty.server.PHP_SELF|escape}-->" >
<input type="hidden" name="mode" value="">
<input type="hidden" name="status" value="<!--{if $arrForm.status == ""}-->1<!--{else}--><!--{$arrForm.status}--><!--{/if}-->" >
<input type="hidden" name="search_pageno" value="<!--{$tpl_pageno}-->" >
<input type="hidden" name="order_id" value="">
<div class="title_page">
<h2><!--{$tpl_subtitle}--></h2>
</div>



<!--登録テーブルここから-->
<!--{if $tpl_linemax > 0 }-->
<h3>
<select name="change_status">
<option value="" selected="selected" style="<!--{$Errormes|sfGetErrorColor}-->" >選択してください</option> 
<!--{foreach key=key item=item from=$arrORDERSTATUS}-->
	<!--{if $key ne $SelectedStatus}-->
	<option value="<!--{$key}-->" ><!--{$item}--></option>
	<!--{/if}-->
<!--{/foreach}-->
<option value="delete">削除</option>
</select>
<input type="button" name="regist" value="反映" onclick="fnSelectCheckSubmit();">
</h3>


<p>
<!--{$tpl_linemax}-->件が該当しました。
<!--{$tpl_strnavi}-->
<!--▲ページナビ-->
</p>


<div class="btn_box place-right">
<input type="button" name="btn01" value="全て選択" onclick="fnBoxChecked(true);">
<input type="button" name="btn01" value="全て解除" onclick="fnBoxChecked(false);">
</div>


<div class="menuclass">
<table summary="ステータス一覧">
<tr>
<th>受注番号</th><th>受注日</th><th>顧客名</th><th>支払方法</th><th>購入金額（円）</th><th>発送日</th><th>対応状況</th><th>選択</th>
</tr>
		<!--{section name=cnt loop=$arrStatus}-->
		<!--{assign var=status value="`$arrStatus[cnt].status`"}-->
		<tr bgcolor="<!--{$arrORDERSTATUS_COLOR[$status]}-->">
		<td align="center">
		<a href ="<!--{$smarty.server.PHP_SELF|escape}-->" onclick="fnOpenWindow('./edit.php?order_id=<!--{$arrStatus[cnt].order_id}-->','order_disp','800','900'); return false;" ><!--{$arrStatus[cnt].order_id}-->
		</td>
		<td><!--{$arrStatus[cnt].create_date|sfDispDBDate:false}--></td>
		<td><!--{$arrStatus[cnt].order_name01|escape}--><!--{$arrStatus[cnt].order_name02|escape}--></td>
		<!--{assign var=payment_id value=`$arrStatus[cnt].payment_id`}-->
		<td><!--{$arrPayment[$payment_id]|escape}--></td>
		<td align="right"><!--{$arrStatus[cnt].total|number_format}--></td>
		<td>
		<!--{if $arrStatus[cnt].status eq 5}--><!--{$arrStatus[cnt].commit_date|sfDispDBDate:false}--><!--{else}-->未発送<!--{/if}-->
		</td>
		<td><!--{$arrORDERSTATUS[$status]}--></td>
		<td><input type="checkbox" name="move[]" value="<!--{$arrStatus[cnt].order_id}-->" ></td>
		</tr>
		<!--{/section}-->
</table>
</div>



<div class="btn_box place-right">
<input type="hidden" name="move[]" value="" >
<input type="button" name="btn01" value="全て選択" onclick="fnBoxChecked(true);">
<input type="button" name="btn01" value="全て解除" onclick="fnBoxChecked(false);">
</div>


<div class="menuclass">
<!--{$tpl_strnavi}-->
<!--▲ページナビ-->
</div>


								<!--{elseif $arrStatus != "" & $tpl_linemax == 0}-->
								<div class="nodata">
								<p>該当するデータはありません。</p>
								</div>
								<!--{/if}-->

</form>

<script type="text/javascript">
<!--
	function fnSelectCheckSubmit(){ 

		var selectflag = 0; 
		var fm = document.form1;
				
		if(fm.change_status.options[document.form1.change_status.selectedIndex].value == ""){ 
		selectflag = 1; 
		} 
		
		if(selectflag == 1){ 
			alert('セレクトボックスが選択されていません'); 
			return false;
		}
		var i;
		var checkflag = 0;
		var max = fm["move[]"].length;
		
		if(max) {
			for (i=0;i<max;i++){
				if(fm["move[]"][i].checked == true){
					checkflag = 1;
				}
			}
		} else {
			if(fm["move[]"].checked == true) {
				checkflag = 1;
			}
		}

		if(checkflag == 0){
			alert('チェックボックスが選択されていません');
			return false;
		}
		
		if(selectflag == 0 && checkflag == 1){ 
		document.form1.mode.value = 'update';
		document.form1.submit(); 
		}
	}
	
	function fnBoxChecked(check){
		var count;
		var fm = document.form1;
		var max = fm["move[]"].length;
		for(count=0; count<max; count++){
			fm["move[]"][count].checked = check;
		}
	}
	
//-->
</script>

</div>
</div>
